<?php
	require_once("global.php");
	require_once("modules/security_mod.php");
	require_once("alerter/modules/account_mod.php");

	SecurityMod::login();

	$level = $_SESSION["account"]->getLevel();
	if ($level != "Admin")
		SecurityMod::logout();

	$validation= v($_REQUEST, "validation");
	$level = v($_REQUEST, "level");
	$pilot = v($_REQUEST, "pilot");
	
	//echo $pilot." ".$level." ".$validation;

	AlertAccountMod::addAccount(
		new AlertAccount(
			0,
			$pilot,
			$level,
			$validation
		)
	);

	header('location: alert_accounts.php');
?>